package com.synergy.stockflow.sales.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.synergy.stockflow.sales.entity.CustomerResources;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.synergy.stockflow.sales.entity.Quotation;
import com.synergy.stockflow.sales.mapper.QuotationMapper;
import com.synergy.stockflow.sales.service.QuotationService;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class QuotationServiceImpl extends ServiceImpl<QuotationMapper, Quotation> implements QuotationService{


    @Override
    public Page<Quotation> getQuotation(Page<Quotation> page,int current,
                                        int size, String quotationId, String quotaitionDateOfSigning, Double beginquotationSalesActually,String quotationHeadOfSales, Double endquotationSalesActually, String customerResourcesName, String warehouseId) {
        List<Quotation> quotation = baseMapper.getQuotation(page, quotationId, quotaitionDateOfSigning, beginquotationSalesActually,quotationHeadOfSales, endquotationSalesActually, customerResourcesName, warehouseId);
        page.setRecords(quotation);
        return page;
    }

    @Override
    public int update(String quotationId) {
        baseMapper.update(quotationId);
        return 0;
    }
    @Override
    public Page<Quotation> selectWhere(Page<Quotation> page,int current,
                                        int size, String quotationState) {
        List<Quotation> quotation = baseMapper.selectWhere(page, quotationState);
        page.setRecords(quotation);
        return page;
    }

    @Override
    public int updateQuotationState(String quotationId, String quotationState) {
        baseMapper.updateQuotationState(quotationId, quotationState);
        return 0;
    }

}
